<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>添加商家</title>
<!--{ include file="header.html" }-->
<script language="javascript">
function chkAddForm(){
	var sellersn = $('#SellerSn').val();
	var sellerno = $('#SellerNo').val();
	var sellername = $('#SellerNameCN').val();
	
	if(!sellersn || !sellerno || !sellername){
		alert('请完整资料！');
		return false;
	}
}

function changeProvince(pid){
	var sellerCity = $('#SellerCityID');
	var sellerCbd = $('#SellerCBDID');
	if(pid == 0){
		sellerCity.val(0);
		sellerCbd.val(0);
	}
	$.ajax({
	  url: "./index.php?module=seller&act=list",
	  type: "POST",
	  dataType: "json",
	  data: "step=ajax_getcity&pid=" + pid,
	  cache: false,
	  success: function(data){
		sellerCity.empty();
		sellerCity.append('<option value="0">--请选择城市--</option>');
		$.each(data, function(i, n){
			sellerCity.append('<option value="'+ n['cid'] +'">'+n['cname']+'</option>');
		})
	  }
	}); 
}
function changeCity(cid){
	var sellerCbd = $('#SellerCBDID');
	if(cid == 0){
		sellerCbd.val(0);
	}
	$.ajax({
	  url: "./index.php?module=seller&act=list",
	  type: "POST",
	  dataType: "json",
	  data: "step=ajax_getcbd&cid=" + cid,
	  cache: false,
	  success: function(data){
		sellerCbd.empty();
		sellerCbd.append('<option value="0">--请选择商圈--</option>');
		$.each(data, function(i, n){
			sellerCbd.append('<option value="'+ n['cbdid'] +'">'+n['cbdname']+'</option>');
		})
	  }
	}); 
}
</script>
</head>

<body>
<div style="float:left">
<form name="form_excel_upload" action="./index.php?module=seller&act=list" method="post" enctype="multipart/form-data">
上传EXCEL文件：<input type="file" name="excel_upload" value="" />
<input type="hidden" name="step" value="excel_upload" />
<input type="submit" name="submit" value="上传" />
</form>
</div>
<div align="right"><input type="button" name="addnewseller" value="商家列表" onclick="javascript:window.location.href='./index.php?module=seller&act=list';" /></div><br/>
<form name="form_seller_add" method="post" action="./index.php?module=seller&act=list" enctype="multipart/form-data" onSubmit="return chkAddForm();">
<table width="100%"  border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#0066FF">
  <tr bgcolor="#96d6f8">
    <td height="20" colspan="2">&nbsp;添加商家</td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td width="30%" height="20" align="right" bgcolor="#FFFFFF">商家编号：</td>
    <td><input name="SellerSn" type="text" id="SellerSn" value="<!--{ $seller.SellerSn }-->"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td width="30%" height="20" align="right" bgcolor="#FFFFFF">商家门牌号：</td>
    <td><input name="SellerNo" type="text" id="SellerNo" value="<!--{ $seller.SellerNo }-->"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="20" align="right" bgcolor="#FFFFFF">商家名称：</td>
    <td><input name="SellerNameCN" type="text" id="SellerNameCN" value="<!--{ $seller.SellerNameCN }-->"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="20" align="right" bgcolor="#FFFFFF">商家分类：</td>
    <td>
	<select name="SellerClassID" id="SellerClassID">
		<option value="0">--请选择商家分类--</option>
		<!--{foreach name=cates from=$cates item=pcate}-->
		<option value="<!--{$pcate.SellerClassID}-->" <!--{if $pcate.SellerClassID == $cate.SellerClassID}--> selected <!--{/if}--> >
		<!--{$pcate.SellerClassName}-->
		</option>
		<!--{/foreach}-->
	</select>
	</td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="20" align="right" bgcolor="#FFFFFF">商家LOGO：</td>
    <td><input name="SellerLogoUrl" type="file" id="SellerLogoUrl" value="<!--{ $seller.SellerLogoUrl }-->"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="20" align="right" bgcolor="#FFFFFF">商家省份：</td>
    <td>
	<select name="SellerProvinceID" id="SellerProvinceID" onchange="changeProvince(this.value);">
	<option value="0">--请选择省份--</option>
	<!--{foreach name=provinces from=$provinces item=province}-->
	<option value="<!--{$province.pid}-->" <!--{if $province.pid == $city.SellerProvinceID}--> selected <!--{/if}--> ><!--{$province.pchar}-->-<!--{$province.pname}-->				    </option>
	<!--{/foreach}-->
	</select>
	</td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="20" align="right" bgcolor="#FFFFFF">商家城市：</td>
    <td>
	<select name="SellerCityID" id="SellerCityID" onchange="changeCity(this.value);">
	<option value="0">--请选择城市--</option>
	<!--{foreach name=cities from=$cities item=city}-->
	<option value="<!--{$city.cid}-->" <!--{if $city.cid == $area.SellerCityID}--> selected <!--{/if}--> ><!--{$city.cname}--></option>
	<!--{/foreach}-->
	</select>
	</td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="20" align="right" bgcolor="#FFFFFF">商圈：</td>
    <td>
	<select name="SellerCBDID" id="SellerCBDID">
	<option value="0">--请选择商圈--</option>
	<!--{foreach name=cbds from=$cbds item=cbd}-->
	<option value="<!--{$cbd.cbdid}-->" <!--{if $cbd.cbdid == $seller.SellerCBDID}--> selected <!--{/if}--> ><!--{$cbd.cbdname}--></option>
	<!--{/foreach}-->
	</select>
	</td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="20" align="right" bgcolor="#FFFFFF">商家类型：</td>
    <td>
	<select name="SellerType" id="SellerType">
		<option value="1" <!--{if $seller.SellerType == 1}-->selected<!--{/if}--> >合作商家</option>
		<option value="2" <!--{if $seller.SellerType == 2}-->selected<!--{/if}--> >普通商家</option>
	</select>
	</td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="20" align="right" bgcolor="#FFFFFF">地址：</td>
    <td><input name="SellerAddress" type="text" id="SellerAddress" value="<!--{ $seller.SellerAddress }-->"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="20" align="right" bgcolor="#FFFFFF">电话：</td>
    <td><input name="SellerTel" type="text" id="SellerTel" value="<!--{ $seller.SellerTel }-->"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="20" align="right" bgcolor="#FFFFFF">电话转线：</td>
    <td><input name="SellerTel_z" type="text" id="SellerTel_z" value="<!--{ $seller.SellerTel_z }-->"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="20" align="right" bgcolor="#FFFFFF">营业时间：</td>
    <td><input name="SellerTime" type="text" id="SellerTime" value="<!--{ $seller.SellerTime }-->"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="20" align="right" bgcolor="#FFFFFF">乘车指南：</td>
    <td><input name="SellerTraffic" type="text" id="SellerTraffic" value="<!--{ $seller.SellerTraffic }-->"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="20" align="right" bgcolor="#FFFFFF">醒目标识：</td>
    <td><input name="SellerSign" type="text" id="SellerSign" value="<!--{ $seller.SellerSign }-->"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="20" align="right" bgcolor="#FFFFFF">特色产品：</td>
    <td><input name="SellerRecommend" type="text" id="SellerRecommend" value="<!--{ $seller.SellerRecommend }-->"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="20" align="right" bgcolor="#FFFFFF">消费指数：</td>
    <td><input name="SellerConsume" type="text" id="SellerConsume" value="<!--{ $seller.SellerConsume }-->"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="20" align="right" bgcolor="#FFFFFF">其他信息：</td>
    <td><input name="SellerOther" type="text" id="SellerOther" value="<!--{ $seller.SellerOther }-->"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="20" bgcolor="#FFFFFF">&nbsp;</td>
    <td><input type="submit" name="Submit" value="提交">
      <input type="reset" name="Submit" value="重置">
      <input type="hidden" name="step" value="do_add">
      </td>
  </tr>

</table>
</form>
</body>
</html>